Do not allow two different apps to have the same autostart-desktop file
Metadata
Current evaluation
No evaluation has been recorded for this issue yet.
Issue body
We had a bug in ubuntu-software where the same desktop file was used as an autostart script, this was causing snapd to always launch the desktop file as the wrong application.
This was the wrong snapcraft.yaml file:
- https://gitlab.gnome.org/Community/Ubuntu/gnome-software/-/blob/eb26457f1/snap/snapcraft.yaml#L55-78
In fact, as per: https://github.com/snapcore/snapd/blob/6b29eb8f/usersession/autostart/autostart.go#L184-L188 the application binary used for auto-start is automatically computed by snapd, but at the same time the first app matching the desktop-id (or well, in this case its basename) is picked: https://github.com/snapcore/snapd/blob/6b29eb8f/usersession/autostart/autostart.go#L159-L165
So, snapcraft should use a stronger check to ensure that a desktop-id is not shared by multiple auto-start entries for different apps, otherwise snapd will not be able to launch the correct application.
Snapd could also do some stronger checks, based on the exec file, but that would make its logic more complex.
Evaluation history
No evaluation history available.